]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
baseAppView: Call loadGrid() directly
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 29 Jun 2019 16:22:08 +0000 (13:22 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 6 Aug 2019 00:19:25 +0000 (21:19 -0300)
Now that the three views follow the exact same loading routine
(remove all + load apps + load grid), we don't need each view
call loadGrid() directly anymore.

This is an important step in order to animate adding and removing
icons, since now we can diff old and new app icons properly.

Move all calls to BaseAppView.loadGrid() to a single one after
BaseAppView._loadApps(). Also add the underscore prefix, since
this is now considered a protected function.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

js/ui/appDisplay.js

index b1a2e5603b7afa2039cd22a172c4294837d58f50..c235f87f8096bba01ad9e69e7422128f66ca9f6b 100644 (file)
@@ -123,6 +123,7 @@ class BaseAppView {
     _redisplay() {
         this.removeAll();
         this._loadApps();
+        this._loadGrid();
     }
 
     getAllItems() {
@@ -146,7 +147,7 @@ class BaseAppView {
         return a.name.localeCompare(b.name);
     }
 
-    loadGrid() {
+    _loadGrid() {
         this._allItems.sort(this._compareItems);
         this._allItems.forEach(item => this._grid.addItem(item));
         this.emit('view-loaded');
@@ -417,8 +418,10 @@ var AllView = class AllView extends BaseAppView {
                                    { isDraggable: favoritesWritable });
             this.addItem(icon);
         });
+    }
 
-        this.loadGrid();
+    _loadGrid() {
+        super._loadGrid();
         this._refilterApps();
     }
 
@@ -733,8 +736,6 @@ var FrequentView = class FrequentView extends BaseAppView {
                                       { isDraggable: favoritesWritable });
             this.addItem(appIcon);
         }
-
-        this.loadGrid();
     }
 
     // Called before allocation to calculate dynamic spacing
@@ -1173,8 +1174,6 @@ var FolderView = class FolderView extends BaseAppView {
 
             addAppId(appInfo.get_id());
         });
-
-        this.loadGrid();
     }
 };